//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by FernFlower decompiler)
//

package org.ligson.springbootrestdao.tx;


import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.orm.jpa.JpaTransactionManager;
import org.springframework.transaction.TransactionSystemException;
import org.springframework.transaction.support.DefaultTransactionStatus;

public class CruxJpaTransactionManager extends JpaTransactionManager {
    private static final Logger log = LoggerFactory.getLogger(CruxJpaTransactionManager.class);

    public CruxJpaTransactionManager() {
    }

    protected void doCommit(DefaultTransactionStatus status) {
        log.debug("开始提交事务,事务状态信息,isReadOnly:{},\nisNewTransaction:{},\nisCompleted:{},\nisNewSynchronization:{},\nhasTransaction:{},\nisRollbackOnly:{},\nisGlobalRollbackOnly:{},\nisLocalRollbackOnly:{},\ngetTransaction():{}", new Object[]{status.isReadOnly(), status.isNewTransaction(), status.isCompleted(), status.isNewSynchronization(), status.hasTransaction(), status.isRollbackOnly(), status.isGlobalRollbackOnly(), status.isLocalRollbackOnly(), status.getTransaction()});

        try {
            super.doCommit(status);
            log.debug("提交事务成功");
        } catch (TransactionSystemException var3) {
            if (var3.getCause() != null && var3.getCause().getCause() != null) {
//                if (var3.getCause().getCause() instanceof BusinessException) {
//                    throw (BusinessException)var3.getCause().getCause();
//                }
//
//                if (var3.getCause().getCause() instanceof InnerException) {
//                    throw (InnerException)var3.getCause().getCause();
//                }
//
//                if (var3.getCause().getCause() instanceof ForwardException) {
//                    throw (ForwardException)var3.getCause().getCause();
//                }
            }

            log.error("提交事务失败:{}", var3.getMessage(), var3);
            throw var3;
        }
    }
}
